package com.tsx.dictionary.controller;

import com.tsx.dictionary.enums.GenderEnum;
import com.tsx.dictionary.utils.DictionaryUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/enum")
public class DictionaryController {
    @RequestMapping("/dictionary")
    public List<Map<String, Object>> getDictionary() {
        return DictionaryUtil.getDictionaryList(GenderEnum.class, GenderEnum::getCode, GenderEnum::getDesc);
    }
}
